package com.webmuseum.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.HasVerticalAlignment;

public class LoginComposite extends Composite
{
	public LoginComposite() {
		
		LayoutPanel layoutPanel = new LayoutPanel();
		initWidget(layoutPanel);
		
		FlexTable flexTable = new FlexTable();
		layoutPanel.add(flexTable);
		layoutPanel.setWidgetLeftRight(flexTable, 110.0, Unit.PX, 111.0, Unit.PX);
		layoutPanel.setWidgetTopBottom(flexTable, 71.0, Unit.PX, 66.0, Unit.PX);
		
		Label lblUsername = new Label("Username");
		flexTable.setWidget(0, 0, lblUsername);
		
		TextBox mUsernameBox = new TextBox();
		flexTable.setWidget(0, 1, mUsernameBox);
		mUsernameBox.setHeight("100%");
		
		Label lblPassword = new Label("Password");
		flexTable.setWidget(1, 0, lblPassword);
		
		TextBox mPasswordBox = new TextBox();
		flexTable.setWidget(1, 1, mPasswordBox);
		mPasswordBox.setHeight("100%");
		flexTable.getCellFormatter().setHorizontalAlignment(1, 1, HasHorizontalAlignment.ALIGN_CENTER);
		flexTable.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER);
		flexTable.getCellFormatter().setHorizontalAlignment(3, 1, HasHorizontalAlignment.ALIGN_CENTER);
		flexTable.getCellFormatter().setVerticalAlignment(3, 1, HasVerticalAlignment.ALIGN_MIDDLE);
		
		PushButton mSignInButton = new PushButton("Sign in");
		flexTable.setWidget(3, 1, mSignInButton);
		mSignInButton.setWidth("77px");

	}
}
